package com.pulaien.shop.controller;

import com.pulaien.common.core.controller.BaseController;
import com.pulaien.common.core.domain.AjaxResult;
import com.pulaien.system.domain.LaundryLabelTemplate;
import com.pulaien.system.service.ILaundryLabelTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 水洗标模板Controller
 *
 * @author pulaien
 */
@RestController
@RequestMapping("/shop/laundryLabel")
@Api(tags = "商城端水洗标模板")
public class ShopLaundryLabelTemplateController extends BaseController
{
    @Autowired
    private ILaundryLabelTemplateService laundryLabelTemplateService;

    @ApiOperation("根据客户id查询所有水洗标")
    @RequestMapping(value = "/getAllByCustomerId/{customerId}", method = RequestMethod.GET)
    @ResponseBody
    public AjaxResult getAllByCustomerId(@PathVariable(value = "customerId")Long customerId) {
        List<LaundryLabelTemplate> orderList = laundryLabelTemplateService.getAllByCustomerId(customerId);
        return AjaxResult.success(orderList);
    }

    @ApiOperation("查询该客户所有水洗标")
    @RequestMapping(value = "/getAll", method = RequestMethod.GET)
    @ResponseBody
    public AjaxResult getAll() {
        List<LaundryLabelTemplate> orderList = laundryLabelTemplateService.getAll();
        return AjaxResult.success(orderList);
    }
}
